<div class="row"><div class="span10 offset1">
	<?php echo flash_message();?>
<?php 

if (isset($users) ) { 
if(count($users)>0)
{	
	
	?>
	
<header>
<div class="row-fluid">			<h3 class="tabs_involved">Users Managament</h3>	

<?php 
echo form_open('user/index',array("class"=>"well form-search"));   echo form_input('search',set_value('search','search'));
echo form_submit('submit',set_value('submit','search'));
echo form_fieldset_close();  
?>

</header>



<?php

	$tmpl = array (
                    'table_open'=> '<table class="tablesorter table table-bordered" cellspacing="0">',
              );

$this->table->set_template($tmpl); 
	foreach ($users as $user) {					$links = '<div class="btn-group"><a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i> User</a><a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a><ul class="dropdown-menu">';		$links .= '<li>';  		$links .= anchor('user/edit/' . $user->getId(), '<i class="icon-pencil"></i> Edit');		$links .='</li>';		$links .= '<li>';  		$links .= anchor('user/delete/' . $user->getId(), '<i class="icon-trash"></i> Delete',array('onclick'=>"return confirm('Are you sure want to delete this user?')"));		$links .='</li>';					$links .= "<ul></div>";		
		$this -> table -> set_heading('First Name', 'Last Name', 'Email', 'Actions');
		$this -> table -> add_row($user->getFirstName(), $user->getLastName(), $user->getEmail(), $links);
	}

	echo $this -> table -> generate();
	
	if (PAGINATION_ENABLED && isset($this -> pagination))
	{
		echo '<div class="pagination_container">' . $this -> pagination -> create_links() . '</div>';
	}
?>
<div class="other_actions">
	<?php echo anchor('user/create','Add User',array("class"=>"btn btn-primary"));?>
</div>	
<?php 
}}
 else{
 	?>
	 <p  style="padding-left: 10px">no result found.... <?php echo anchor('user/create','Create a User',array("class"=>"btn btn-primary"));?></p> 
<?php
 }
 ?>

</div>
</div>